package servicesImp.specific;


import base.response.OffsetLimitPage;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import services.specific.FinanceSelectServices;
import wt.dao.specific.FinanceSelectMapper;
import wt.entity.specific.FinanceSelect;

import java.util.Date;
import java.util.List;


/**
 * Created by Administrator on 2017/9/13.
 */
@Service
public class FinanceSelectServicesImp implements FinanceSelectServices {

    @Autowired
    FinanceSelectMapper financeSelectMapper;

    public List<FinanceSelect> select(String expertName, String idCard, String bankName, Date startTime, Date endTime) throws Exception {
        return financeSelectMapper.select(expertName, idCard, bankName, startTime, endTime);
    }

    public OffsetLimitPage select(String expertName, String idCard, String bankName, Date startTime, Date endTime, Integer offset, Integer limit) throws Exception {
        PageHelper.offsetPage(offset, limit);
        List<FinanceSelect> financeSelectList = financeSelectMapper.select(expertName, idCard, bankName, startTime, endTime);
        return new OffsetLimitPage((Page) financeSelectList);
    }
}
